#include "projectile.h"
#include "ennemis.h"

Projectile::Projectile(Ennemis * macible, float f):QGraphicsItem(),frappe(f),cible(macible)
{
}

void Projectile::paint(QPainter *painter,const QStyleOptionGraphicsItem *option, QWidget *widget){
    painter->drawRect(0,0,10,10);
}

QRectF Projectile::boundingRect()const{
    return QRect(0,0,600,600);
}
void Projectile::advance(int i){
    //modifier pos
    if(i==0)
        return;
    else if(collidesWithItem(cible)&& !touche)
    {
        cible->toucher(this);
        touche=true;
    }

}
